package org.example;

public class Car {
    private String _color;
    private String _brand;
    private double _price;

    public Car() {}

    public Car(String color, String brand, double price) {
        _color = color;
        _brand = brand;
        _price = price;
    }

    public void moveForward() {
        System.out.println("汽车正在前进");
    }

    public void moveBackward() {
        System.out.println("汽车正在后退");
    }

    public void turn() {
        System.out.println("汽车正在转弯");
    }

    public void printCarInfo() {
        System.out.println("颜色：" + _color + ", 品牌：" +
                _brand + ", 价格：" + _price);
    }

    public String getColor() {
        return _color;
    }

    public void setColor(String color) {
        _color = color;
    }

    public String getBrand() {
        return _brand;
    }

    public void setBrand(String brand) {
        _brand = brand;
    }

    public double getPrice() {
        return _price;
    }

    public void setPrice(double price) {
        _price = price;
    }

}
